home *** CD-ROM | disk | FTP | other *** search
/ Interactive Media Design Review 1999 / Interactive Media Design Review 1999.iso / pc / allfiles / Itch / work_info / flashPlayer.dcr / 00004_Button Parent.ls < prev    next >
Encoding:
Text File  |  1999-03-07  |  846 b   |  49 lines

  1. property sp, cst, rct, state
  2.  
  3. on new me, asp
  4.   me.sp = asp
  5.   me.cst = member(the member of sprite me.sp).name
  6.   temp = item 1 of the cst of me
  7.   SwapCast(me, temp & ",norm")
  8.   me.rct = the rect of sprite me.sp
  9.   me.state = #default
  10.   return me
  11. end
  12.  
  13. on CheckState me
  14.   case me.state of
  15.     #default:
  16.       CheckOver(me)
  17.     #normal:
  18.       DoNormal(me)
  19.     #over:
  20.       DoOver(me)
  21.   end case
  22. end
  23.  
  24. on CheckOver me
  25.   if inside(the mouseLoc, me.rct) then
  26.     temp = item 1 of the cst of me
  27.     SwapCast(me, temp & ",over")
  28.     me.state = #over
  29.   end if
  30. end
  31.  
  32. on DoNormal me
  33.   temp = item 1 of the cst of me
  34.   SwapCast(me, temp & ",norm")
  35.   me.state = #default
  36. end
  37.  
  38. on DoOver me
  39.   if inside(the mouseLoc, me.rct) then
  40.   else
  41.     me.state = #normal
  42.   end if
  43. end
  44.  
  45. on SwapCast me, aMem
  46.   me.cst = aMem
  47.   set the member of sprite the sp of me to me.cst
  48. end
  49.